revert(bricks): remove SF colour border/box-shadow fixes - #212
Conversation
📝 WalkthroughWalkthroughColorPanel picker interaction is refactored from per-button dataset suppression flags to root-level mousedown propagation stopping. Component-owned event binding and pick() suppression logic are removed. All swatch button data-cp-pick-var attributes are removed across panel sections and the ColorSwatch component. Integration button mousedown listener is removed. ChangesColor picker event handling simplification
Possibly related PRs
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reverts commits 93da924, cafa170, and 18303c0. The mousedown-based approach to beat Bricks' click-outside handlers did not work reliably after a Bricks update. Removing all three fix commits so the border/box-shadow SF colour flow can be addressed separately. https://claude.ai/code/session_016aL3vh5nHHa2QbmAxyFCGy
3507b00 to
ed77906
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte (1)
202-203: 💤 Low valueBoth
onclickandonmousedownpropagation stops are present.The review stack context describes this change as "Switch panel root event handling from onclick propagation stop to onmousedown propagation stop", which suggests
onclickshould have been replaced. However, both handlers are now present on the panel root.Functionally, this is safe and defensive—it stops propagation for both event types regardless of whether Bricks listens to click or mousedown events. If this dual-handler approach is intentional for maximum compatibility, consider briefly documenting it in a comment. Otherwise, if
onclickis no longer needed, it could be removed to match the stated simplification intent.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte` around lines 202 - 203, The panel root in ColorPanel.svelte currently has both onclick and onmousedown propagation stops but the change intent was to switch from onclick to onmousedown; remove the redundant onclick={(e) => e.stopPropagation()} attribute so only onmousedown={(e) => e.stopPropagation()} remains on the panel root (or, if you intended to keep both for compatibility, replace removal with a one-line comment above the handlers explaining the deliberate dual handling); locate these attributes in the ColorPanel.svelte component and update accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte`:
- Around line 202-203: The panel root in ColorPanel.svelte currently has both
onclick and onmousedown propagation stops but the change intent was to switch
from onclick to onmousedown; remove the redundant onclick={(e) =>
e.stopPropagation()} attribute so only onmousedown={(e) => e.stopPropagation()}
remains on the panel root (or, if you intended to keep both for compatibility,
replace removal with a one-line comment above the handlers explaining the
deliberate dual handling); locate these attributes in the ColorPanel.svelte
component and update accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 89de1537-8cc2-4dad-8714-29af4cbad28e
📒 Files selected for processing (4)
plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.jsplugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelteplugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorSwatch.svelteplugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js
💤 Files with no reviewable changes (2)
- plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorSwatch.svelte
- plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js
Summary
93da924,cafa170,18303c0) that were introduced to handle event-ordering issues with Bricks' click-outside handlerdata-cp-pick-varattribute on swatch buttons, directaddEventListenerinonMount, suppress flag inpick(), and SF button mousedown handler incolor-swatches.jseditor-app/assets/app.jsto match the reverted sourceWhy
The fix relied on firing our mousedown handler at element level (before Bricks' document-level click-outside handler), but a Bricks update changed the event handling in a way that broke this approach. The border/box-shadow SF colour selection will be handled manually.
Test plan
Generated by Claude Code
Summary by CodeRabbit